import { Component, OnInit } from '@angular/core';

@Component({
  selector: 'total-table',
  templateUrl: './total-table.component.html',
  styleUrls: ['./total-table.component.scss']
})
export class TotalTableComponent implements OnInit {

  radioValue = 'A';
  pagination = false;
  dataSet = [];
  rightNewDataSet = [];
  constructor() {
  }

  ngOnInit() {
    for (let i = 1; i <= 100; i++) {
      this.dataSet.push({
        key: i,
        enname: 'bitcoin',
        name: 'BTC-比特币',
        marketValue: 8674,
        price: 50469,
        amount: 1719,
        deal: 2645567,
        updown: i % 2 ? 0 - Math.random() / 10 : Math.random() / 10,
        color: i % 2 ? false : true
      });
    }
    for (let i = 1; i <= 5; i++) {
      this.rightNewDataSet.push({
        name: `WEB${i}`,
        price: 50469,
        updown: i % 2 ? 0 - Math.random() / 10 : Math.random() / 10,
        time: '今天',
        color: i % 2 ? false : true
      });
    }
  }

  // 选择查看的币种
  currencyChange(params) {
    console.log(params);
  }
}
